package com.jwater.core.manager.worker;

import com.jwater.core.manager.common.model.WorkerInfo;
import com.jwater.core.net.Node;

/**
 * @description: worker上下文
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public interface WorkerContext {
    /**
     * 获取worker编号
     *
     * @return
     */
    public int getWorkerIndex();

    /**
     * 获取配置信息
     *
     * @return
     */
    public WorkerInfo getWorkerInfo();

    /**
     * 设置回调handler
     *
     * @param handler
     */
    public void setHandler(WorkerHandler handler);

    /**
     * 获取通信节点
     * @return
     */
    public Node getNode();
}
